{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 世界人口回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "import torch\n",
    "import torch.nn\n",
    "import torch.optim"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "读取数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Year</th>\n",
       "      <th>United States Census Bureau (2017)[28]</th>\n",
       "      <th>Population Reference Bureau (1973–2016)[15]</th>\n",
       "      <th>United Nations Department of Economic and Social Affairs (2015)[16]</th>\n",
       "      <th>Maddison (2008)[17]</th>\n",
       "      <th>HYDE (2007)[24]</th>\n",
       "      <th>Tanton (1994)[18]</th>\n",
       "      <th>Biraben (1980)[19]</th>\n",
       "      <th>McEvedy &amp; Jones (1978)[20]</th>\n",
       "      <th>Thomlinson (1975)[21]</th>\n",
       "      <th>Durand (1974)[22]</th>\n",
       "      <th>Clark (1967)[23]</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1950</td>\n",
       "      <td>2557628654</td>\n",
       "      <td>2.516000e+09</td>\n",
       "      <td>2.525149e+09</td>\n",
       "      <td>2.544000e+09</td>\n",
       "      <td>2.527960e+09</td>\n",
       "      <td>2.400000e+09</td>\n",
       "      <td>2.527000e+09</td>\n",
       "      <td>2.500000e+09</td>\n",
       "      <td>2.400000e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.486000e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1951</td>\n",
       "      <td>2594939877</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.572851e+09</td>\n",
       "      <td>2.571663e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1952</td>\n",
       "      <td>2636772306</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.619292e+09</td>\n",
       "      <td>2.617949e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1953</td>\n",
       "      <td>2682053389</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.665865e+09</td>\n",
       "      <td>2.665959e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1954</td>\n",
       "      <td>2730228104</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.713172e+09</td>\n",
       "      <td>2.716927e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1955</td>\n",
       "      <td>2782098943</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.761651e+09</td>\n",
       "      <td>2.769074e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>1956</td>\n",
       "      <td>2835299673</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.811572e+09</td>\n",
       "      <td>2.822502e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1957</td>\n",
       "      <td>2891349717</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.863043e+09</td>\n",
       "      <td>2.879934e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1958</td>\n",
       "      <td>2948137248</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.916030e+09</td>\n",
       "      <td>2.939254e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1959</td>\n",
       "      <td>3000716593</td>\n",
       "      <td>NaN</td>\n",
       "      <td>2.970396e+09</td>\n",
       "      <td>2.995909e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>1960</td>\n",
       "      <td>3043001508</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.026003e+09</td>\n",
       "      <td>3.041507e+09</td>\n",
       "      <td>3.042000e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>1961</td>\n",
       "      <td>3083966929</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.082830e+09</td>\n",
       "      <td>3.082161e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>1962</td>\n",
       "      <td>3140093217</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.141072e+09</td>\n",
       "      <td>3.135787e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.036000e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>1963</td>\n",
       "      <td>3209827882</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.201178e+09</td>\n",
       "      <td>3.201354e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>1964</td>\n",
       "      <td>3281201306</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.263739e+09</td>\n",
       "      <td>3.266477e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>1965</td>\n",
       "      <td>3350425793</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.329122e+09</td>\n",
       "      <td>3.333138e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>1966</td>\n",
       "      <td>3420677923</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.397475e+09</td>\n",
       "      <td>3.402224e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.288000e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>1967</td>\n",
       "      <td>3490333715</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.468522e+09</td>\n",
       "      <td>3.471464e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>1968</td>\n",
       "      <td>3562313822</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.541675e+09</td>\n",
       "      <td>3.543086e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>1969</td>\n",
       "      <td>3637159050</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.616109e+09</td>\n",
       "      <td>3.615743e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>1970</td>\n",
       "      <td>3712697742</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.691173e+09</td>\n",
       "      <td>3.691157e+09</td>\n",
       "      <td>3.710000e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.637000e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.600000e+09</td>\n",
       "      <td>3,600,000,000– 3,700,000,000</td>\n",
       "      <td>3.632000e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>1971</td>\n",
       "      <td>3790326948</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.766754e+09</td>\n",
       "      <td>3.769818e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>1972</td>\n",
       "      <td>3866568653</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.842874e+09</td>\n",
       "      <td>3.846499e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>1973</td>\n",
       "      <td>3942096442</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.919182e+09</td>\n",
       "      <td>3.922793e+09</td>\n",
       "      <td>3.923000e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.860000e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>1974</td>\n",
       "      <td>4016608813</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.995305e+09</td>\n",
       "      <td>3.997677e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>1975</td>\n",
       "      <td>4089083233</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.071020e+09</td>\n",
       "      <td>4.070671e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>3.900000e+09</td>\n",
       "      <td>4.000000e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>1976</td>\n",
       "      <td>4160185010</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.146136e+09</td>\n",
       "      <td>4.141445e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>1977</td>\n",
       "      <td>4232084578</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.220817e+09</td>\n",
       "      <td>4.213539e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>1978</td>\n",
       "      <td>4304105753</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.295665e+09</td>\n",
       "      <td>4.286317e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>1979</td>\n",
       "      <td>4379013942</td>\n",
       "      <td>NaN</td>\n",
       "      <td>4.371528e+09</td>\n",
       "      <td>4.363144e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>37</th>\n",
       "      <td>1987</td>\n",
       "      <td>5027200492</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.045316e+09</td>\n",
       "      <td>5.006672e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38</th>\n",
       "      <td>1988</td>\n",
       "      <td>5114557167</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.138215e+09</td>\n",
       "      <td>5.093306e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>1989</td>\n",
       "      <td>5201440110</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.230000e+09</td>\n",
       "      <td>5.180540e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>40</th>\n",
       "      <td>1990</td>\n",
       "      <td>5288955934</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.320817e+09</td>\n",
       "      <td>5.269029e+09</td>\n",
       "      <td>5.308000e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>1991</td>\n",
       "      <td>5371585922</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.408909e+09</td>\n",
       "      <td>5.351922e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>1992</td>\n",
       "      <td>5456136278</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.494900e+09</td>\n",
       "      <td>5.435722e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>1993</td>\n",
       "      <td>5538268316</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.578865e+09</td>\n",
       "      <td>5.518127e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>1994</td>\n",
       "      <td>5618682132</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.661086e+09</td>\n",
       "      <td>5.599396e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>1995</td>\n",
       "      <td>5699202985</td>\n",
       "      <td>5.760000e+09</td>\n",
       "      <td>5.741822e+09</td>\n",
       "      <td>5.681575e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46</th>\n",
       "      <td>1996</td>\n",
       "      <td>5779440593</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.821017e+09</td>\n",
       "      <td>5.762212e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>1997</td>\n",
       "      <td>5857972543</td>\n",
       "      <td>5.840000e+09</td>\n",
       "      <td>5.898688e+09</td>\n",
       "      <td>5.842122e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>1998</td>\n",
       "      <td>5935213248</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.975304e+09</td>\n",
       "      <td>5.921366e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49</th>\n",
       "      <td>1999</td>\n",
       "      <td>6012074922</td>\n",
       "      <td>NaN</td>\n",
       "      <td>6.051478e+09</td>\n",
       "      <td>5.999622e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>2000</td>\n",
       "      <td>6088571383</td>\n",
       "      <td>6.067000e+09</td>\n",
       "      <td>6.127700e+09</td>\n",
       "      <td>6.076558e+09</td>\n",
       "      <td>6.145000e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>5.750000e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>2001</td>\n",
       "      <td>6165219247</td>\n",
       "      <td>6.137000e+09</td>\n",
       "      <td>6.204147e+09</td>\n",
       "      <td>6.154791e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>52</th>\n",
       "      <td>2002</td>\n",
       "      <td>6242016348</td>\n",
       "      <td>6.215000e+09</td>\n",
       "      <td>6.280854e+09</td>\n",
       "      <td>6.231704e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>2003</td>\n",
       "      <td>6318590956</td>\n",
       "      <td>6.314000e+09</td>\n",
       "      <td>6.357992e+09</td>\n",
       "      <td>6.308364e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>54</th>\n",
       "      <td>2004</td>\n",
       "      <td>6395699509</td>\n",
       "      <td>6.396000e+09</td>\n",
       "      <td>6.435706e+09</td>\n",
       "      <td>6.374056e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>55</th>\n",
       "      <td>2005</td>\n",
       "      <td>6473044732</td>\n",
       "      <td>6.477000e+09</td>\n",
       "      <td>6.514095e+09</td>\n",
       "      <td>6.462987e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>56</th>\n",
       "      <td>2006</td>\n",
       "      <td>6551263534</td>\n",
       "      <td>6.555000e+09</td>\n",
       "      <td>6.593228e+09</td>\n",
       "      <td>6.540214e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>57</th>\n",
       "      <td>2007</td>\n",
       "      <td>6629913759</td>\n",
       "      <td>6.625000e+09</td>\n",
       "      <td>6.673106e+09</td>\n",
       "      <td>6.616689e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>58</th>\n",
       "      <td>2008</td>\n",
       "      <td>6709049780</td>\n",
       "      <td>6.705000e+09</td>\n",
       "      <td>6.753649e+09</td>\n",
       "      <td>6.694832e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>2009</td>\n",
       "      <td>6788214394</td>\n",
       "      <td>6.809972e+09</td>\n",
       "      <td>6.834722e+09</td>\n",
       "      <td>6.764086e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>2010</td>\n",
       "      <td>6858584755</td>\n",
       "      <td>6.892319e+09</td>\n",
       "      <td>6.916183e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>2011</td>\n",
       "      <td>6935999491</td>\n",
       "      <td>6.986951e+09</td>\n",
       "      <td>6.997999e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>2012</td>\n",
       "      <td>7013871313</td>\n",
       "      <td>7.057075e+09</td>\n",
       "      <td>7.080072e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>2013</td>\n",
       "      <td>7092128094</td>\n",
       "      <td>7.136796e+09</td>\n",
       "      <td>7.162119e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>2014</td>\n",
       "      <td>7169968185</td>\n",
       "      <td>7.238184e+09</td>\n",
       "      <td>7.243784e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>2015</td>\n",
       "      <td>7247892788</td>\n",
       "      <td>7.336435e+09</td>\n",
       "      <td>7.349472e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66</th>\n",
       "      <td>2016</td>\n",
       "      <td>7325996709</td>\n",
       "      <td>7.418152e+09</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>67 rows × 12 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    Year  United States Census Bureau (2017)[28]  \\\n",
       "0   1950                              2557628654   \n",
       "1   1951                              2594939877   \n",
       "2   1952                              2636772306   \n",
       "3   1953                              2682053389   \n",
       "4   1954                              2730228104   \n",
       "5   1955                              2782098943   \n",
       "6   1956                              2835299673   \n",
       "7   1957                              2891349717   \n",
       "8   1958                              2948137248   \n",
       "9   1959                              3000716593   \n",
       "10  1960                              3043001508   \n",
       "11  1961                              3083966929   \n",
       "12  1962                              3140093217   \n",
       "13  1963                              3209827882   \n",
       "14  1964                              3281201306   \n",
       "15  1965                              3350425793   \n",
       "16  1966                              3420677923   \n",
       "17  1967                              3490333715   \n",
       "18  1968                              3562313822   \n",
       "19  1969                              3637159050   \n",
       "20  1970                              3712697742   \n",
       "21  1971                              3790326948   \n",
       "22  1972                              3866568653   \n",
       "23  1973                              3942096442   \n",
       "24  1974                              4016608813   \n",
       "25  1975                              4089083233   \n",
       "26  1976                              4160185010   \n",
       "27  1977                              4232084578   \n",
       "28  1978                              4304105753   \n",
       "29  1979                              4379013942   \n",
       "..   ...                                     ...   \n",
       "37  1987                              5027200492   \n",
       "38  1988                              5114557167   \n",
       "39  1989                              5201440110   \n",
       "40  1990                              5288955934   \n",
       "41  1991                              5371585922   \n",
       "42  1992                              5456136278   \n",
       "43  1993                              5538268316   \n",
       "44  1994                              5618682132   \n",
       "45  1995                              5699202985   \n",
       "46  1996                              5779440593   \n",
       "47  1997                              5857972543   \n",
       "48  1998                              5935213248   \n",
       "49  1999                              6012074922   \n",
       "50  2000                              6088571383   \n",
       "51  2001                              6165219247   \n",
       "52  2002                              6242016348   \n",
       "53  2003                              6318590956   \n",
       "54  2004                              6395699509   \n",
       "55  2005                              6473044732   \n",
       "56  2006                              6551263534   \n",
       "57  2007                              6629913759   \n",
       "58  2008                              6709049780   \n",
       "59  2009                              6788214394   \n",
       "60  2010                              6858584755   \n",
       "61  2011                              6935999491   \n",
       "62  2012                              7013871313   \n",
       "63  2013                              7092128094   \n",
       "64  2014                              7169968185   \n",
       "65  2015                              7247892788   \n",
       "66  2016                              7325996709   \n",
       "\n",
       "    Population Reference Bureau (1973–2016)[15]  \\\n",
       "0                                  2.516000e+09   \n",
       "1                                           NaN   \n",
       "2                                           NaN   \n",
       "3                                           NaN   \n",
       "4                                           NaN   \n",
       "5                                           NaN   \n",
       "6                                           NaN   \n",
       "7                                           NaN   \n",
       "8                                           NaN   \n",
       "9                                           NaN   \n",
       "10                                          NaN   \n",
       "11                                          NaN   \n",
       "12                                          NaN   \n",
       "13                                          NaN   \n",
       "14                                          NaN   \n",
       "15                                          NaN   \n",
       "16                                          NaN   \n",
       "17                                          NaN   \n",
       "18                                          NaN   \n",
       "19                                          NaN   \n",
       "20                                          NaN   \n",
       "21                                          NaN   \n",
       "22                                          NaN   \n",
       "23                                          NaN   \n",
       "24                                          NaN   \n",
       "25                                          NaN   \n",
       "26                                          NaN   \n",
       "27                                          NaN   \n",
       "28                                          NaN   \n",
       "29                                          NaN   \n",
       "..                                          ...   \n",
       "37                                          NaN   \n",
       "38                                          NaN   \n",
       "39                                          NaN   \n",
       "40                                          NaN   \n",
       "41                                          NaN   \n",
       "42                                          NaN   \n",
       "43                                          NaN   \n",
       "44                                          NaN   \n",
       "45                                 5.760000e+09   \n",
       "46                                          NaN   \n",
       "47                                 5.840000e+09   \n",
       "48                                          NaN   \n",
       "49                                          NaN   \n",
       "50                                 6.067000e+09   \n",
       "51                                 6.137000e+09   \n",
       "52                                 6.215000e+09   \n",
       "53                                 6.314000e+09   \n",
       "54                                 6.396000e+09   \n",
       "55                                 6.477000e+09   \n",
       "56                                 6.555000e+09   \n",
       "57                                 6.625000e+09   \n",
       "58                                 6.705000e+09   \n",
       "59                                 6.809972e+09   \n",
       "60                                 6.892319e+09   \n",
       "61                                 6.986951e+09   \n",
       "62                                 7.057075e+09   \n",
       "63                                 7.136796e+09   \n",
       "64                                 7.238184e+09   \n",
       "65                                 7.336435e+09   \n",
       "66                                 7.418152e+09   \n",
       "\n",
       "    United Nations Department of Economic and Social Affairs (2015)[16]  \\\n",
       "0                                        2.525149e+09                     \n",
       "1                                        2.572851e+09                     \n",
       "2                                        2.619292e+09                     \n",
       "3                                        2.665865e+09                     \n",
       "4                                        2.713172e+09                     \n",
       "5                                        2.761651e+09                     \n",
       "6                                        2.811572e+09                     \n",
       "7                                        2.863043e+09                     \n",
       "8                                        2.916030e+09                     \n",
       "9                                        2.970396e+09                     \n",
       "10                                       3.026003e+09                     \n",
       "11                                       3.082830e+09                     \n",
       "12                                       3.141072e+09                     \n",
       "13                                       3.201178e+09                     \n",
       "14                                       3.263739e+09                     \n",
       "15                                       3.329122e+09                     \n",
       "16                                       3.397475e+09                     \n",
       "17                                       3.468522e+09                     \n",
       "18                                       3.541675e+09                     \n",
       "19                                       3.616109e+09                     \n",
       "20                                       3.691173e+09                     \n",
       "21                                       3.766754e+09                     \n",
       "22                                       3.842874e+09                     \n",
       "23                                       3.919182e+09                     \n",
       "24                                       3.995305e+09                     \n",
       "25                                       4.071020e+09                     \n",
       "26                                       4.146136e+09                     \n",
       "27                                       4.220817e+09                     \n",
       "28                                       4.295665e+09                     \n",
       "29                                       4.371528e+09                     \n",
       "..                                                ...                     \n",
       "37                                       5.045316e+09                     \n",
       "38                                       5.138215e+09                     \n",
       "39                                       5.230000e+09                     \n",
       "40                                       5.320817e+09                     \n",
       "41                                       5.408909e+09                     \n",
       "42                                       5.494900e+09                     \n",
       "43                                       5.578865e+09                     \n",
       "44                                       5.661086e+09                     \n",
       "45                                       5.741822e+09                     \n",
       "46                                       5.821017e+09                     \n",
       "47                                       5.898688e+09                     \n",
       "48                                       5.975304e+09                     \n",
       "49                                       6.051478e+09                     \n",
       "50                                       6.127700e+09                     \n",
       "51                                       6.204147e+09                     \n",
       "52                                       6.280854e+09                     \n",
       "53                                       6.357992e+09                     \n",
       "54                                       6.435706e+09                     \n",
       "55                                       6.514095e+09                     \n",
       "56                                       6.593228e+09                     \n",
       "57                                       6.673106e+09                     \n",
       "58                                       6.753649e+09                     \n",
       "59                                       6.834722e+09                     \n",
       "60                                       6.916183e+09                     \n",
       "61                                       6.997999e+09                     \n",
       "62                                       7.080072e+09                     \n",
       "63                                       7.162119e+09                     \n",
       "64                                       7.243784e+09                     \n",
       "65                                       7.349472e+09                     \n",
       "66                                                NaN                     \n",
       "\n",
       "    Maddison (2008)[17]  HYDE (2007)[24]  Tanton (1994)[18]  \\\n",
       "0          2.544000e+09     2.527960e+09       2.400000e+09   \n",
       "1          2.571663e+09              NaN                NaN   \n",
       "2          2.617949e+09              NaN                NaN   \n",
       "3          2.665959e+09              NaN                NaN   \n",
       "4          2.716927e+09              NaN                NaN   \n",
       "5          2.769074e+09              NaN                NaN   \n",
       "6          2.822502e+09              NaN                NaN   \n",
       "7          2.879934e+09              NaN                NaN   \n",
       "8          2.939254e+09              NaN                NaN   \n",
       "9          2.995909e+09              NaN                NaN   \n",
       "10         3.041507e+09     3.042000e+09                NaN   \n",
       "11         3.082161e+09              NaN                NaN   \n",
       "12         3.135787e+09              NaN                NaN   \n",
       "13         3.201354e+09              NaN                NaN   \n",
       "14         3.266477e+09              NaN                NaN   \n",
       "15         3.333138e+09              NaN                NaN   \n",
       "16         3.402224e+09              NaN                NaN   \n",
       "17         3.471464e+09              NaN                NaN   \n",
       "18         3.543086e+09              NaN                NaN   \n",
       "19         3.615743e+09              NaN                NaN   \n",
       "20         3.691157e+09     3.710000e+09                NaN   \n",
       "21         3.769818e+09              NaN                NaN   \n",
       "22         3.846499e+09              NaN                NaN   \n",
       "23         3.922793e+09     3.923000e+09                NaN   \n",
       "24         3.997677e+09              NaN                NaN   \n",
       "25         4.070671e+09              NaN                NaN   \n",
       "26         4.141445e+09              NaN                NaN   \n",
       "27         4.213539e+09              NaN                NaN   \n",
       "28         4.286317e+09              NaN                NaN   \n",
       "29         4.363144e+09              NaN                NaN   \n",
       "..                  ...              ...                ...   \n",
       "37         5.006672e+09              NaN                NaN   \n",
       "38         5.093306e+09              NaN                NaN   \n",
       "39         5.180540e+09              NaN                NaN   \n",
       "40         5.269029e+09     5.308000e+09                NaN   \n",
       "41         5.351922e+09              NaN                NaN   \n",
       "42         5.435722e+09              NaN                NaN   \n",
       "43         5.518127e+09              NaN                NaN   \n",
       "44         5.599396e+09              NaN                NaN   \n",
       "45         5.681575e+09              NaN                NaN   \n",
       "46         5.762212e+09              NaN                NaN   \n",
       "47         5.842122e+09              NaN                NaN   \n",
       "48         5.921366e+09              NaN                NaN   \n",
       "49         5.999622e+09              NaN                NaN   \n",
       "50         6.076558e+09     6.145000e+09                NaN   \n",
       "51         6.154791e+09              NaN                NaN   \n",
       "52         6.231704e+09              NaN                NaN   \n",
       "53         6.308364e+09              NaN                NaN   \n",
       "54         6.374056e+09              NaN                NaN   \n",
       "55         6.462987e+09              NaN                NaN   \n",
       "56         6.540214e+09              NaN                NaN   \n",
       "57         6.616689e+09              NaN                NaN   \n",
       "58         6.694832e+09              NaN                NaN   \n",
       "59         6.764086e+09              NaN                NaN   \n",
       "60                  NaN              NaN                NaN   \n",
       "61                  NaN              NaN                NaN   \n",
       "62                  NaN              NaN                NaN   \n",
       "63                  NaN              NaN                NaN   \n",
       "64                  NaN              NaN                NaN   \n",
       "65                  NaN              NaN                NaN   \n",
       "66                  NaN              NaN                NaN   \n",
       "\n",
       "    Biraben (1980)[19]  McEvedy & Jones (1978)[20]  Thomlinson (1975)[21]  \\\n",
       "0         2.527000e+09                2.500000e+09           2.400000e+09   \n",
       "1                  NaN                         NaN                    NaN   \n",
       "2                  NaN                         NaN                    NaN   \n",
       "3                  NaN                         NaN                    NaN   \n",
       "4                  NaN                         NaN                    NaN   \n",
       "5                  NaN                         NaN                    NaN   \n",
       "6                  NaN                         NaN                    NaN   \n",
       "7                  NaN                         NaN                    NaN   \n",
       "8                  NaN                         NaN                    NaN   \n",
       "9                  NaN                         NaN                    NaN   \n",
       "10                 NaN                         NaN                    NaN   \n",
       "11                 NaN                         NaN                    NaN   \n",
       "12                 NaN                         NaN                    NaN   \n",
       "13                 NaN                         NaN                    NaN   \n",
       "14                 NaN                         NaN                    NaN   \n",
       "15                 NaN                         NaN                    NaN   \n",
       "16                 NaN                         NaN                    NaN   \n",
       "17                 NaN                         NaN                    NaN   \n",
       "18                 NaN                         NaN                    NaN   \n",
       "19                 NaN                         NaN                    NaN   \n",
       "20        3.637000e+09                         NaN           3.600000e+09   \n",
       "21                 NaN                         NaN                    NaN   \n",
       "22                 NaN                         NaN                    NaN   \n",
       "23                 NaN                         NaN                    NaN   \n",
       "24                 NaN                         NaN                    NaN   \n",
       "25                 NaN                3.900000e+09           4.000000e+09   \n",
       "26                 NaN                         NaN                    NaN   \n",
       "27                 NaN                         NaN                    NaN   \n",
       "28                 NaN                         NaN                    NaN   \n",
       "29                 NaN                         NaN                    NaN   \n",
       "..                 ...                         ...                    ...   \n",
       "37                 NaN                         NaN                    NaN   \n",
       "38                 NaN                         NaN                    NaN   \n",
       "39                 NaN                         NaN                    NaN   \n",
       "40                 NaN                         NaN                    NaN   \n",
       "41                 NaN                         NaN                    NaN   \n",
       "42                 NaN                         NaN                    NaN   \n",
       "43                 NaN                         NaN                    NaN   \n",
       "44                 NaN                         NaN                    NaN   \n",
       "45                 NaN                         NaN                    NaN   \n",
       "46                 NaN                         NaN                    NaN   \n",
       "47                 NaN                         NaN                    NaN   \n",
       "48                 NaN                         NaN                    NaN   \n",
       "49                 NaN                         NaN                    NaN   \n",
       "50                 NaN                5.750000e+09                    NaN   \n",
       "51                 NaN                         NaN                    NaN   \n",
       "52                 NaN                         NaN                    NaN   \n",
       "53                 NaN                         NaN                    NaN   \n",
       "54                 NaN                         NaN                    NaN   \n",
       "55                 NaN                         NaN                    NaN   \n",
       "56                 NaN                         NaN                    NaN   \n",
       "57                 NaN                         NaN                    NaN   \n",
       "58                 NaN                         NaN                    NaN   \n",
       "59                 NaN                         NaN                    NaN   \n",
       "60                 NaN                         NaN                    NaN   \n",
       "61                 NaN                         NaN                    NaN   \n",
       "62                 NaN                         NaN                    NaN   \n",
       "63                 NaN                         NaN                    NaN   \n",
       "64                 NaN                         NaN                    NaN   \n",
       "65                 NaN                         NaN                    NaN   \n",
       "66                 NaN                         NaN                    NaN   \n",
       "\n",
       "               Durand (1974)[22]  Clark (1967)[23]  \n",
       "0                            NaN      2.486000e+09  \n",
       "1                            NaN               NaN  \n",
       "2                            NaN               NaN  \n",
       "3                            NaN               NaN  \n",
       "4                            NaN               NaN  \n",
       "5                            NaN               NaN  \n",
       "6                            NaN               NaN  \n",
       "7                            NaN               NaN  \n",
       "8                            NaN               NaN  \n",
       "9                            NaN               NaN  \n",
       "10                           NaN               NaN  \n",
       "11                           NaN               NaN  \n",
       "12                           NaN      3.036000e+09  \n",
       "13                           NaN               NaN  \n",
       "14                           NaN               NaN  \n",
       "15                           NaN               NaN  \n",
       "16                           NaN      3.288000e+09  \n",
       "17                           NaN               NaN  \n",
       "18                           NaN               NaN  \n",
       "19                           NaN               NaN  \n",
       "20  3,600,000,000– 3,700,000,000      3.632000e+09  \n",
       "21                           NaN               NaN  \n",
       "22                           NaN               NaN  \n",
       "23                           NaN      3.860000e+09  \n",
       "24                           NaN               NaN  \n",
       "25                           NaN               NaN  \n",
       "26                           NaN               NaN  \n",
       "27                           NaN               NaN  \n",
       "28                           NaN               NaN  \n",
       "29                           NaN               NaN  \n",
       "..                           ...               ...  \n",
       "37                           NaN               NaN  \n",
       "38                           NaN               NaN  \n",
       "39                           NaN               NaN  \n",
       "40                           NaN               NaN  \n",
       "41                           NaN               NaN  \n",
       "42                           NaN               NaN  \n",
       "43                           NaN               NaN  \n",
       "44                           NaN               NaN  \n",
       "45                           NaN               NaN  \n",
       "46                           NaN               NaN  \n",
       "47                           NaN               NaN  \n",
       "48                           NaN               NaN  \n",
       "49                           NaN               NaN  \n",
       "50                           NaN               NaN  \n",
       "51                           NaN               NaN  \n",
       "52                           NaN               NaN  \n",
       "53                           NaN               NaN  \n",
       "54                           NaN               NaN  \n",
       "55                           NaN               NaN  \n",
       "56                           NaN               NaN  \n",
       "57                           NaN               NaN  \n",
       "58                           NaN               NaN  \n",
       "59                           NaN               NaN  \n",
       "60                           NaN               NaN  \n",
       "61                           NaN               NaN  \n",
       "62                           NaN               NaN  \n",
       "63                           NaN               NaN  \n",
       "64                           NaN               NaN  \n",
       "65                           NaN               NaN  \n",
       "66                           NaN               NaN  \n",
       "\n",
       "[67 rows x 12 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "try:\n",
    "    url = r'http://en.wikipedia.org/wiki/World_population_estimates'\n",
    "    df = pd.read_html(url, header=0, attrs={\"class\" : \"wikitable\"})[2]\n",
    "except:\n",
    "    url = 'http://raw.githubusercontent.com/zhiqingxiao/pytorch-book/master/chapter05_linear/population.csv'\n",
    "    df = pd.read_csv(url, index_col=0)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "years = torch.tensor(df.iloc[:, 0], dtype=torch.float32)\n",
    "populations = torch.tensor(df.iloc[:, 1], dtype=torch.float32)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "线性回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "回归结果：population = 7.53e+07 * year + -1.45e+11\n"
     ]
    }
   ],
   "source": [
    "x = torch.stack([years, torch.ones_like(years)], 1)\n",
    "y = populations\n",
    "wr, _ = torch.lstsq(y, x)\n",
    "slope, intercept = wr[:2, 0]\n",
    "result = 'population = {:.2e} * year + {:.2e}'.format(slope, intercept)\n",
    "print('回归结果：' + result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "回归结果：population = 7.55e+07 * year + -1.45e+11\n"
     ]
    }
   ],
   "source": [
    "x = torch.stack([years, torch.ones_like(years)], 1)\n",
    "y = populations\n",
    "w = x.t().mm(x).inverse().mm(x.t()).mv(y)\n",
    "slope, intercept = w\n",
    "result = 'population = {:.2e} * year + {:.2e}'.format(slope, intercept)\n",
    "print('回归结果：' + result)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAERCAYAAAB4jRxOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAIABJREFUeJzt3XlYVNUbwPHvUUvNrVwzqTQrBQREUDFzL7fKLS1NU3JBRTM1S8vdn7lkuaVomAuZC6mZS6kpChiuoIgI7mKaioqK5gp4fn8wTCggozkLzPt5nnm43Hvm3pdheDnz3nPPVVprhBBC5H55rB2AEEIIy5CEL4QQdkISvhBC2AlJ+EIIYSck4QshhJ2QhC+EEHbC5hK+UmqeUuq8UirahLYvKqWClFJRSqlgpZSDJWIUQoicyOYSPrAAaGpi22+AH7XWrsAYYLy5ghJCiJzO5hK+1joUuJR+nVKqolJqvVIqQim1VSlV2bDJCQgyLG8BWlowVCGEyFFsLuFnwR/4WGvtAQwC/Azr9wHvGpZbA0WUUiWsEJ8QQti8fNYOIDtKqcLAa8AypVTa6vyGr4OAGUopbyAU+BtItnSMQgiRE9h8wif1U8gVrXXV+zdorc8AbcD4j+FdrXWiheMTQogcweZLOlrrq8AJpVQ7AJXKzbBcUimV9jN8AcyzUphCCGHzbC7hK6WWANuBSkqp00qpbkBHoJtSah9wgH9PztYHDimlDgNlgK+sELIQQuQISqZHFkII+2BzPXwhhBDmYVMnbUuWLKnLly9v7TCEECL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QtxH631fqXUaGCTYZriJKAXqTcfiSF1ZsrjQJj1ohTi4ckoHSGEsBNS0hFCCDshCV8IIeyEJHwhhLATkvCFEMJOSMIXQgg7IQlfCCHshCR8IYSwE/8H5z8qRXMrS5YAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(years, populations, s=0.1, label='actual', color='k')\n",
    "plt.plot(years.tolist(), (slope * years + intercept).tolist(), label=result, color='k')\n",
    "plt.xlabel('Year')\n",
    "plt.ylabel('Population')\n",
    "plt.legend()\n",
    "plt.show();"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "第0步：weight = -2051082.75, bias = 9893657600.0\n",
      "第1000步：weight = 54465700.0, bias = -103104684032.0\n",
      "第2000步：weight = 73434320.0, bias = -140840599552.0\n",
      "第3000步：weight = 75267792.0, bias = -144477749248.0\n",
      "第4000步：weight = 75291000.0, bias = -144523771904.0\n",
      "第5000步：weight = 75291104.0, bias = -144523968512.0\n",
      "回归结果：population = 7.53e+07 * year + -1.45e+11\n"
     ]
    }
   ],
   "source": [
    "x = years.reshape(-1, 1)\n",
    "y = populations\n",
    "\n",
    "x_mean, x_std = torch.mean(x), torch.std(x)\n",
    "x_norm = (x - x_mean) / x_std\n",
    "y_mean, y_std = torch.mean(y), torch.std(y)\n",
    "y_norm = (y - y_mean) / y_std\n",
    "\n",
    "fc = torch.nn.Linear(1, 1)\n",
    "criterion = torch.nn.MSELoss()\n",
    "optimizer = torch.optim.Adam(fc.parameters())\n",
    "weight_norm, bias_norm = fc.parameters()\n",
    "\n",
    "for step in range(5001):\n",
    "    if step:\n",
    "        fc.zero_grad()\n",
    "        loss_norm.backward()\n",
    "        optimizer.step()\n",
    "    output_norm = fc(x_norm)\n",
    "    pred_norm = output_norm.squeeze()\n",
    "    loss_norm = criterion(pred_norm, y_norm)\n",
    "    weight = y_std / x_std * weight_norm\n",
    "    bias = (weight_norm * (0 - x_mean) / x_std + bias_norm) * y_std + y_mean\n",
    "    if step % 1000 == 0:\n",
    "        print('第{}步：weight = {}, bias = {}'.format(step, weight.item(), bias.item()))\n",
    "\n",
    "result = 'population = {:.2e} * year + {:.2e}'.format(weight.item(), bias.item())\n",
    "print('回归结果：' + result)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
